package cn.ifavor.appframework.lifecycle;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import cn.ifavor.appframework.R;
import cn.ifavor.appframework.lifecycle.app.DefaultApplication;
import cn.ifavor.appframework.lifecycle.bean.User;

public class HomeActivity extends AppCompatActivity {

    private TextView mTvName;
    private TextView mTvAge;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);

        mTvName = (TextView) findViewById(R.id.tv_name);
        mTvAge = (TextView) findViewById(R.id.tv_age);

        // 初始化数据
        User user = DefaultApplication.sUser;
        String name = user.getName();
        int age = user.getAge();
        mTvName.setText(name);
        mTvAge.setText(String.valueOf(age));

    }



}
